import request from "./request";

const zhihu = "http://localhost:9000/proxy/zhihu";

// 知乎搜索栏接口
export const apiGetSearch = (data?: any) => {
  return request(zhihu, {
    params: {
      ...data,
    },
    headers: {
      proxy: "https://www.zhihu.com/api/v4/search/suggest",
    },
  });
};

// 获取知乎热门搜索数据
export const apiGetHotSearch = () => {
  return request(zhihu, {
    headers: {
      proxy: "https://www.zhihu.com/api/v4/search/top_search",
    },
  });
};

// 获取知乎首页推荐数据
export const apiGetHomeRecommend = () => {
  return request(zhihu, {
    params: {
      limit: 10,
      desktop: true,
    },
    headers: {
      proxy: "https://www.zhihu.com/api/v3/feed/topstory/recommend",
    },
  });
};
